#include <pthread.h>
#include <stdio.h>
#include <signal.h>

//sig_atomic_t count = 0;
int count = 0;

void *func1 (void *arg)
{
    for (int i = 0; i < 1000000; ++i)
    {
	count = i;
	printf ("n1= [%d] ", count);
    }
}
void *func2 (void *arg)
{
    for (int i = 1000000; i > 0; --i)
    {
	count = i;
	printf ("n2= [%d] ", count);
    }
}
int main ()
{
    pthread_t pid1, pid2;
    pthread_create (&pid1, NULL, func1, NULL);
    pthread_create (&pid2, NULL, func2, NULL);
    pthread_join (pid1, 0);
    pthread_join (pid2, 0);
}
